<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/
Route::group(['prefix' => 'admin', 'namespace' => 'Admin', 'middleware' => 'auth'], function () {
    Route::get('/', 'SiteController@index');
    Route::get('/index', 'SiteController@index');

    Route::get('/admin/index', 'AdminController@index');
    Route::get('/admin/', 'AdminController@index');
    Route::get('/admin/create', 'AdminController@create');
    Route::post('/admin/store', 'AdminController@store');
    Route::get('/admin/edit/{id}', 'AdminController@edit');
    Route::post('/admin/update/{id}', 'AdminController@update');
    Route::get('/admin/destroy/{id}', 'AdminController@destroy');
    Route::get('/admin/select_power', 'AdminController@selectPower');

    Route::get('/role/index', 'RoleController@index');
    Route::get('/role/', 'RoleController@index');
    Route::get('/role/create', 'RoleController@create');
    Route::get('/role/create/{id}/', 'RoleController@create');
    Route::post('/role/store', 'RoleController@store');
    Route::get('/role/edit/{id}', 'RoleController@edit');
    Route::post('/role/update/{id}', 'RoleController@update');
    Route::get('/role/destroy/{id}', 'RoleController@destroy');

    Route::get('/tieba-nav/index', 'TiebaNavController@index');
    Route::get('/tieba-nav/', 'TiebaNavController@index');
    Route::get('/tieba-nav/create', 'TiebaNavController@create');
    Route::get('/tieba-nav/create/{id}/', 'TiebaNavController@create');
    Route::post('/tieba-nav/store', 'TiebaNavController@store');
    Route::get('/tieba-nav/edit/{id}', 'TiebaNavController@edit');
    Route::post('/tieba-nav/update/{id}', 'TiebaNavController@update');
    Route::get('/tieba-nav/destroy/{id}', 'TiebaNavController@destroy');

});

Route::group(['namespace' => 'Frontend'], function () {
    Route::get('/', 'SiteController@index');
    Route::get('/index', 'SiteController@index');
    Route::get('/checkcode', 'SiteController@checkcode');

    Route::post('/member/login', 'MemberController@login');
});

Route::group(['prefix' => 'auth', 'namespace' => 'Auth'], function () {
    Route::get('/admin_login', ['middleware' => 'guest', 'uses' => 'AuthController@getAdminLogin']);
    Route::post('/admin_login', ['middleware' => 'guest', 'uses' => 'AuthController@postAdminLogin']);
    Route::get('/admin_logout', 'AuthController@getAdminLogout');
});


Route::controllers([
    'auth' => 'Auth\AuthController',
    'password' => 'Auth\PasswordController',
]);
